package com.qifan.energy.netWork;


import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;

/**
 * @author : FangShiKang
 * @date : 2020/04/11.
 * email : fangshikang@outlook.com
 * desc :   RXjava的被观察者
 */
public interface ObservedApi {

    /**
     * get
     * @param url
     * @return
     */
    @GET
    Observable<ResponseBody> get(@Url String url);

    /**
     * post普通
     * @param url
     * @param map
     * @return
     */
    @POST
    Observable<ResponseBody> post(@Url String url, @QueryMap Map<String, String> map);

    /**
     * post
     * @param url
     * @param map
     * @return
     */
    @Multipart
    @POST
    Observable<ResponseBody> postFormBody(@Url String url,  @PartMap Map<String, RequestBody> map);
}
